package com.feng.boot.mybatis.service.impl;

import com.feng.boot.mybatis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author Lee
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public List<Map<String, Object>> findAll(int start, int size) {
        String sql = "select * from user" + " limit " + start + "," + size;
        return jdbcTemplate.queryForList(sql);
    }

}
